package com.guestmanage.service;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import com.guestmanage.bean.ChannelArgs;
import com.guestmanage.bean.ChannelRecordVO;
import com.guestmanage.dao.ChannelRecordDao;

public class ChannelRecordService {

	private ChannelRecordDao crdao=new ChannelRecordDao();
	
	public List<ChannelRecordVO> queryCRVOMonths(ChannelArgs args,int pageSize,int pageNow){
		return crdao.queryCRVOMonths(args, pageSize, pageNow);
	}
	
	public int getCountMonths(ChannelArgs args){
		return crdao.getCountMonths(args);
	}
	
	public List<ChannelRecordVO> queryForCRVODays(ChannelArgs args,int pageSize,int pageNow){
		return crdao.queryForCRVODays(args, pageSize, pageNow);
	}
	
	public int getCountDays(ChannelArgs args){
		return crdao.getCountDays(args);
	}
	
	public int getMonths(){
		SimpleDateFormat format=new SimpleDateFormat("MM");
		Date d=new Date();
		String months=format.format(d);
		if(Integer.parseInt(months)<10)
			return Integer.parseInt(months.substring(1, 2));
		else
			return Integer.parseInt(months);
	}
	
	public int getDay(){
		SimpleDateFormat format=new SimpleDateFormat("dd");
		Date d=new Date();
		String months=format.format(d);
		if(Integer.parseInt(months)<10)
			return Integer.parseInt(months.substring(1, 2));
		else
			return Integer.parseInt(months);
	}
	
}
